LassoScript Utility
Basics Browse Detail

[Array->Merge]

Tag Link [Array->Merge] Category Array
Type Member Source Available No
Support Preferred Version 5.0
Change Unchanged Data Source Any
Output Type None Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0

Description

[Array->Merge] merges an array parameter into the array. Accepts an array parameter and three integer parameters that identify which items from the array parameter should be inserted into the array. Defaults to inserting the entire array parameter at the end of the array. Returns no value.

The first element in an array is at index 1. An error is returned if any of the indexes specified are beyond the size of the arrays.

The first integer parameter specifies at which index in the base array the merge array should be inserted. Defaults to the end of the base array.

The second integer parameter specifies an offset into the merge array. Elements after this merge index will be copied into the base array. By default, the entire merge array will be copied.

The third integer parameter specifies the number of elements from the merge array which should be copied. By default all elements in the merge array after the merge index will be copied.

Syntax

[Array->(MergeMerge Array)]

[Array->(MergeMerge ArrayArray Index)]

[Array->(MergeMerge ArrayArray IndexMerge Index)]

[Array->(MergeMerge ArrayArray IndexMerge IndexMerge Length)]

Parameters

Required Parameters
Merge Array The array which should be merged onto the end of the base array.
Optional Parameters
Array index The index at which to insert the merge array in the base array. By default the merge array is inserted at the end of the base array.
Merge Index The index into the merge array at which to start copying elements. By default, the entire merge array is copied.
Merge Length The number of elements to copy from the merge array. By default, the entire merge array after the merge index is copied.

Examples

To merge two arrays:

Use the [Array->Merge] tag. The following example merges two arrays, each of which contains a portion of the days of the week. The resulting array is output.

<?LassoScript
  Variable: 'DaysOfWeek'=(Array: 'Sun', 'Mon', 'Tue', 'Wed');
  Variable: 'MoreDays'=(Array: 'Thu', 'Fri', 'Sat');
  $DaysOfWeek->(Merge: $MoreDays);
  Output: $DaysOfWeek;
?>

(Array: (Sun), (Mon), (Tue), (Wed), (Thu), (Fri), (Sat))

Related Tags

Category Tags

Substitution
[Iterator]
[List]
[Map]
[Pair]
[PriorityQueue]
[Queue]
[ReverseIterator]
[Series]
[Set]
[Stack]
[TreeMap]
Member
[Iterator->AtBegin]
[Iterator->AtBottom]
[Iterator->AtEnd]
[Iterator->AtFarLeft]
[Iterator->AtFarRight]
[Iterator->AtTop]
[Iterator->Backward]
[Iterator->Down]
[Iterator->Forward]
[Iterator->InsertAtCurrent]
[Iterator->Key]
[Iterator->Left]
[Iterator->RemoveCurrent]
[Iterator->Reset]
[Iterator->Right]
[Iterator->Up]
[Iterator->Value]
[List->Contains]
[List->Difference]
[List->Find]
[List->FindPosition]
[List->First]
[List->ForEach]
[List->Get]
[List->Insert]
[List->InsertFirst]
[List->InsertFrom]
[List->InsertLast]
[List->Intersection]
[List->Iterator]
[List->Join]
[List->Last]
[List->Remove]
[List->RemoveAll]
[List->RemoveFirst]
[List->RemoveLast]
[List->Reverse]
[List->ReverseIterator]
[List->Second]
[List->Size]
[List->Sort]
[List->SortWith]
[List->Union]
[Map->Contains]
[Map->Find]
[Map->Get]
[Map->Insert]
[Map->InsertFrom]
[Map->Iterator]
[Map->Keys]
[Map->Remove]
[Map->Removeall]
[Map->Size]
[Map->Values]
[Pair->First]
[Pair->Get]
[Pair->Name]
[Pair->Second]
[Pair->Size]
[Pair->Value]
[PriorityQueue->First]
[PriorityQueue->Get]
[PriorityQueue->Insert]
[PriorityQueue->InsertLast]
[PriorityQueue->Remove]
[PriorityQueue->RemoveFirst]
[PriorityQueue->Size]
[Queue->First]
[Queue->Get]
[Queue->Insert]
[Queue->InsertLast]
[Queue->Remove]
[Queue->RemoveFirst]
[Queue->Size]
[ReverseIterator->AtBegin]
[ReverseIterator->AtBottom]
[ReverseIterator->AtEnd]
[ReverseIterator->AtFarLeft]
[ReverseIterator->AtFarRight]
[ReverseIterator->AtTop]
[ReverseIterator->Backward]
[ReverseIterator->Down]
[ReverseIterator->Forward]
[ReverseIterator->InsertAtCurrent]
[ReverseIterator->Key]
[ReverseIterator->Left]
[ReverseIterator->RemoveCurrent]
[ReverseIterator->Reset]
[ReverseIterator->Right]
[ReverseIterator->Up]
[ReverseIterator->Value]
[Set->Contains]
[Set->Difference]
[Set->Find]
[Set->ForEach]
[Set->Get]
[Set->Insert]
[Set->InsertFrom]
[Set->Intersection]
[Set->Iterator]
[Set->Join]
[Set->Remove]
[Set->RemoveAll]
[Set->ReverseIterator]
[Set->Size]
[Set->Union]
[Stack->First]
[Stack->Get]
[Stack->Insert]
[Stack->InsertFirst]
[Stack->Remove]
[Stack->RemoveFirst]
[Stack->Size]
[TreeMap->Contains]
[TreeMap->Find]
[TreeMap->Get]
[TreeMap->Insert]
[TreeMap->Insertfrom]
[TreeMap->Iterator]
[TreeMap->Keys]
[TreeMap->Remove]
[TreeMap->RemoveAll]
[TreeMap->Size]
[TreeMap->Values]